﻿//-----------------------------------------------------------------------------------------//
//-     Writen by Raymond Honderdors
//-     2013-05-14
//-
//-     Code can be used as is, no warrenty
//-     https://solutionmanagementki.codeplex.com/
//-----------------------------------------------------------------------------------------//
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SMK_Explorer_2013
{
    public delegate void dOnConnect(string ServerType, string ServerName);
    public delegate void dOnCancel();

    public partial class LogonForm : Form
    {

        public event dOnConnect eonConnect;
        public event dOnCancel eOnCancel ;
        public LogonForm()
        {
            InitializeComponent();
        }

        protected virtual void OnConnect (string ServerType, string ServerName)
        {
            if (eonConnect != null)
            {
                eonConnect(ServerType, ServerName);
            }
        }

        protected virtual void OnCancel()
        {
            if (eOnCancel != null)
            { 
                eOnCancel(); 
            }
        }
        private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            OnCancel();
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            OnConnect(this.cmbServerType.Text, this.txbServerName.Text);
        }
    }
}
